// This file contains types for signin-related API functions

// This file contains signin-related API functions
import type {
    DailySignInData,
    DailySignInResponses,
    GetMonthlySignInRecordData,
    GetMonthlySignInRecordResponses,
    GetTodaySignStatusData,
    GetTodaySignStatusResponses,
    GetUserSignInStatsData,
    GetUserSignInStatsResponses
} from './signinTypes';
import {client as _heyApiClient} from '../../api/client.gen';
import type {Options} from '../common/apiTypes';


/**
 * 用户每日签到
 */
export const dailySignIn = <ThrowOnError extends boolean = false>(options?: Options<DailySignInData, ThrowOnError>) => {
    return (options?.client ?? _heyApiClient).post<DailySignInResponses, unknown, ThrowOnError>({
        url: '/api/signin/daily',
        ...options
    });
};

/**
 * 查询今日签到状态
 */
export const getTodaySignStatus = <ThrowOnError extends boolean = false>(options?: Options<GetTodaySignStatusData, ThrowOnError>) => {
    return (options?.client ?? _heyApiClient).get<GetTodaySignStatusResponses, unknown, ThrowOnError>({
        url: '/api/signin/today-status',
        ...options
    });
};

/**
 * 获取用户签到统计
 */
export const getUserSignInStats = <ThrowOnError extends boolean = false>(options?: Options<GetUserSignInStatsData, ThrowOnError>) => {
    return (options?.client ?? _heyApiClient).get<GetUserSignInStatsResponses, unknown, ThrowOnError>({
        url: '/api/signin/stats',
        ...options
    });
};

/**
 * 获取月度签到记录
 */
export const getMonthlySignInRecord = <ThrowOnError extends boolean = false>(options: Options<GetMonthlySignInRecordData, ThrowOnError>) => {
    return (options.client ?? _heyApiClient).get<GetMonthlySignInRecordResponses, unknown, ThrowOnError>({
        url: '/api/signin/monthly/{year}/{month}',
        ...options
    });
};